#pragma once
#include <map>

#include "channel.h"

class Poller{
public:
    Poller();
    ~Poller();

    void Poll(std::vector<Channel*>& channels);
    void UpdateChannel(Channel* channel);
    void RemoveChannel(Channel* channel);

private:
    void Update(int operation, Channel* channel);

private:
    int epollFd_;
    std::vector<struct epoll_event> epollEvents_;
    std::map<int, Channel*> channelMap_;
};